#include<bits/stdc++.h>

using namespace std;
const int maxn = 100 + 20;
typedef long long ll;
ll m, n, p, q;

//O(n^3)
int main() {
    cin >> m;
    for (p = 1; p <= m; p++)
        for (q = p + 1; q <= m; q++) {
            ll s = 0;
            for (ll k = p; k <= q; k++) {
                s += k;
            }
            if (s == m) {
                cout << p << " " << q << endl;
            }
        }

}

